#!/usr/bin/env bash

set -e
set -u

rm -rf application.jar
cp ./manager/config-center/target/config-center-*.jar application.jar
docker build -t crpi-glkbor6j5qzr77n9.cn-hangzhou.personal.cr.aliyuncs.com/westkl/config-center:1.0.0-SNAPSHOT .
docker push crpi-glkbor6j5qzr77n9.cn-hangzhou.personal.cr.aliyuncs.com/westkl/config-center:1.0.0-SNAPSHOT

rm -rf application.jar
cp ./manager/service-center/target/service-center-*.jar application.jar
docker build -t crpi-glkbor6j5qzr77n9.cn-hangzhou.personal.cr.aliyuncs.com/westkl/service-center:1.0.0-SNAPSHOT .
docker push crpi-glkbor6j5qzr77n9.cn-hangzhou.personal.cr.aliyuncs.com/westkl/service-center:1.0.0-SNAPSHOT

rm -rf application.jar
cp ./manager/gateway-center/target/gateway-center-*.jar application.jar
docker build -t crpi-glkbor6j5qzr77n9.cn-hangzhou.personal.cr.aliyuncs.com/westkl/gateway-center:1.0.0-SNAPSHOT .
docker push crpi-glkbor6j5qzr77n9.cn-hangzhou.personal.cr.aliyuncs.com/westkl/gateway-center:1.0.0-SNAPSHOT

rm -rf application.jar
cp ./service/base-service/target/base-service-*.jar application.jar
docker build -t crpi-glkbor6j5qzr77n9.cn-hangzhou.personal.cr.aliyuncs.com/westkl/base-service:1.0.0-SNAPSHOT .
docker push crpi-glkbor6j5qzr77n9.cn-hangzhou.personal.cr.aliyuncs.com/westkl/base-service:1.0.0-SNAPSHOT

rm -rf application.jar
cp ./service/data-service/target/data-service-*.jar application.jar
docker build -t crpi-glkbor6j5qzr77n9.cn-hangzhou.personal.cr.aliyuncs.com/westkl/data-service:1.0.0-SNAPSHOT .
docker push crpi-glkbor6j5qzr77n9.cn-hangzhou.personal.cr.aliyuncs.com/westkl/data-service:1.0.0-SNAPSHOT

rm -rf application.jar
cp ./service/docker-service/target/docker-service-*.jar application.jar
docker build -t crpi-glkbor6j5qzr77n9.cn-hangzhou.personal.cr.aliyuncs.com/westkl/docker-service:1.0.0-SNAPSHOT .
docker push crpi-glkbor6j5qzr77n9.cn-hangzhou.personal.cr.aliyuncs.com/westkl/docker-service:1.0.0-SNAPSHOT

rm -rf application.jar